import React from 'react';
import PropTypes from "prop-types";

const ChildCom = (props) => {
  return (
    <div>
      这是子组件
      年龄:{props.age}
      名字:{props.name}
    </div>
  );
};
ChildCom.prototype = {
  name: PropTypes.string,
  age: PropTypes.number.isRequired,
  /**
   *
   * @param props 整体的prop对象
   * @param propName 当前验证的prop属性
   * @param componentName 组件名
   */
  score: PropTypes.arrayOf(function (props, propName, componentName, location, propFullName) {
    console.log(props, propName, componentName, location, propFullName)
  })
}
export default ChildCom;
